home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Sample Code / Pascal Sample 3.0B10 / Source / Print.p < prev    next >
Encoding:
Text File  |  1993-10-13  |  3.2 KB  |  87 lines  |  [TEXT/MPS ]

  1. (******************************************************************************
  2. *
  3. *    Apple Macintosh Developer Technical Support
  4. *
  5. *    Interface for the printing routines
  6. *
  7. *    Program:    Sample 3.0
  8. *    FILE:        Print.p - Pascal implementation
  9. *
  10. *    by:            Matt Deatherage
  11. *                Based on a story by Pete 'Luke' Alexander
  12. *
  13. *    Copyright © 1988-1993 Apple Computer, Inc.
  14. *    All rights reserved.
  15. *
  16. *******************************************************************************
  17. * This unit contains code based on Macintosh Technical Note "A Printing Loop
  18. * That Cares...", which shows a canonical example of how to print on the
  19. * Macintosh.
  20. ******************************************************************************)
  21.  
  22. UNIT PrintStuff; { printing unit based on Luke's caring print loop }
  23.  
  24. INTERFACE
  25.  
  26. (*******************************************************************************
  27. * Used Units
  28. *******************************************************************************)
  29.  
  30. USES Resources, PrintTraps, Packages, AppleTalk, Processes, PPCToolbox, EPPC,
  31.      Notification, AppleEvents, SampleUtilities, TrafficLights;
  32.  
  33. (*******************************************************************************
  34. * Constants
  35. *******************************************************************************)
  36.  
  37. CONST
  38.  
  39.     rPrintingError = 3000;         { Alert saying there was a problem }
  40.  
  41. (*******************************************************************************
  42. *
  43. * Print - make a window or Picture show up on paper
  44. *
  45. * This routine's four parameters allow it to flexibly print windows or
  46. * pictures, with or without PrJobMerge.  The first parameter is this document's
  47. * print record, containing all of its user-specified options in "Page Setup."
  48. * The second parameter is a pointer to a window to be printed.  If this
  49. * parameter is NIL, the third parameter must be a PicHandle (the third
  50. * parameter is ignored otherwise).  The fourth parameter, if not NIL, is
  51. * merged with the first parameter using PrJobMerge.  This lets us get job-
  52. * specific parameters once and print several documents with them.
  53. *
  54. * If the document is larger than one page, it is tiled across several pages
  55. * in drawing-program style.
  56. *
  57. * The returned value indicates whether or not printing was succesful.
  58. *
  59. * The second, third and fourth parameters are all ignored if NIL, but if the
  60. * second parameter is NIL, we'll pass the third parameter to DrawPicture.
  61. *
  62. *******************************************************************************)
  63.  
  64. FUNCTION Print(thePrRecHdl: THPrint; theWindow: WindowPtr; thePict: PicHandle;
  65.                theMergeRec: THPrint): BOOLEAN;
  66.  
  67. (*******************************************************************************
  68. *
  69. * PageSetup - get document-specific formatting options from the user
  70. *
  71. * This routine asks the user to set parameters about the current document,
  72. * including page size, orientation and other "Page Setup..." goodies, using
  73. * the standard Macintosh printing dialogs.  The returned value indicates
  74. * whether or not the user accepted the dialog or not.
  75. *
  76. *******************************************************************************)
  77.  
  78. FUNCTION PageSetup(thePrRecHdl: THPrint): BOOLEAN;
  79.  
  80. IMPLEMENTATION
  81.  
  82. {$I print.inc1.p}
  83.  
  84. END. { unit PrintStuff }
  85.